// File: HexToWatts.cpp
// Author: Peter Horak (2012)
//
// Purpose: convert two's complement hexadecimal of dBm to decimal dBm and milliwatts

#include <iostream>
#include <iomanip>
#include <math.h>

using namespace std;

int main(void)
{
    int rssi;
    cin >> hex >> rssi;
    while (cin && !cin.eof())
    {
        rssi = ((rssi & 0x80) ? -(-rssi & 0xFF) : rssi);
        cout << rssi << "\t" << pow(10,rssi/10.0) << endl;
        cin >> hex >> rssi;
    }
}
